package br.ufpe.cin.imlm2.jbeat.soot.common.filters;

import soot.Scene;
import soot.SootClass;
import soot.SootMethod;

public class LibraryExceptionsFilter extends ThrowableFilter {

	private SootMethod source;

	/**
	 * @param source
	 */
	public LibraryExceptionsFilter(SootMethod source) {
		if (source == null)
			throw new IllegalArgumentException("Source method can't be null");
		this.source = source;
	}

	@Override
	public boolean retains(SootClass t) {
		return super.retains(t)
				&& !Scene.v().getApplicationClasses()
						.contains(this.source.getDeclaringClass());
	}

}
